/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package objects;
import klient.Klient;
import org.newdawn.slick.*;
/**
 *
 * @author Marcin
 */
public class Text2dPrinter {
    public Color col=Color.black;
    public Font2d font=null;
    
    public void setFont(Font2d f){
        font=f;
    }
    public void setFont(String font, int size){
        String ft = "fonts/"+font;
        this.font=Font2dBase.get(ft, size);
    }
    public void setColor(Color c){
        col=c;
    }
    public void write(int x, int y, String txt){
        if(font==null){
            Klient.log("Brak ustawionej czcionki!");
            return;
        }
        font.write(x, y, txt, col);
    }
    
    public static void write(int x, int y,String Text,Color col,String font, int size){
        String ft = "fonts/"+font;
        Font2d f = Font2dBase.get(ft, size);
        f.write(x, y, Text, col);
    }
    public static void write(int x, int y,String Text,Color col,Font2d f){
        f.write(x, y, Text, col);
    }
}
